<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/common/html/head :: head(~{::title},~{::link},~{::style})">

<meta charset="UTF-8">
<title>更新war</title>
<!-- 这儿引用单独的css link -->
<!-- 文件上传css-->
<link th:href="@{/static/assets/dropZone/downloads/css/dropzone.css}" rel="stylesheet"/>

<style type="text/css">
/**
*这里写单独的css样式
*/
</style>


</head>




<body>

		
<div id="dropz"  class="dropzone"></div>

<table id="dataTable" class="table-striped footable-res footable metro-blue" data-page-size="6">
</table>

<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
</div>
<!--文件上传dropzone.js -->
<script th:src="@{/static/assets/dropZone/lib/dropzone.js}" type="text/javascript"></script>

<script type="text/javascript" th:inline="javascript">
$(function(){
    var tomcatName = localStorage.getItem("tomcatName");
    localStorage.removeItem("tomcatName");
	Dropzone.autoDiscover = false;//防止报"Dropzone already attached."的错误
	var myDropzone = new Dropzone("#dropz", {
	       url: rootPath + "/TomcatConfigController/addWar/"+tomcatName,//文件提交地址
	       method:"post",  //也可用put
	       paramName:"file", //默认为file
	       maxFiles:1,//一次性上传的文件数量上限
	       maxFilesize: 1000, //文件大小，单位：MB
	       acceptedFiles: ".war", //上传的类型
	       addRemoveLinks:true,
	       parallelUploads: 1,//一次上传的文件数量
	       //previewsContainer:"#preview",//上传图片的预览窗口
	       dictDefaultMessage:'拖动文件至此或者点击上传',
	       dictMaxFilesExceeded: "您最多只能上传1个文件！",
	       dictResponseError: '文件上传失败!',
	       dictInvalidFileType: "文件类型只能是*.jpg,*.gif,*.png,*.jpeg。",
	       dictFallbackMessage:"浏览器不受支持!",
	       dictFileTooBig:"文件过大上传文件最大支持.",
	       dictRemoveLinks: "删除",
	       dictCancelUpload: "取消",
	       init:function(){
	           this.on("addedfile", function(file) {
	               //上传文件时触发的事件

	           });
	           this.on("success",function(file,data){
	               alert("更新成功");
                   $.modal.close();
	           });
	           this.on("error",function (file,data) {
	               //上传失败触发的事件
	        	   $.modal.alertError("上传失败！");
	           });
	           this.on("removedfile",function(file){//删除文件触发结果



	           });
	       }
	});

})

</script>
</body>
</html>